//
//  NewOrdorListCell.m
//  HCNewGoldFinger
//
//  Created by 刘琛 on 2018/3/12.
//  Copyright © 2018年 zjhcsoftios. All rights reserved.
//

#import "NewOrdorListCell.h"
#import "UIColor+EX.h"

@implementation NewOrdorListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    
    self.MissionDetailButton.layer.cornerRadius = 3;
    self.MissionDetailButton.layer.borderWidth = 1;
    self.MissionDetailButton.layer.borderColor = [UIColor colorWithHexString:@"169BD5"].CGColor;
    [self.MissionDetailButton setTitleColor:[UIColor colorWithHexString:@"169BD5"] forState:UIControlStateNormal];
    
    self.ordorDetailButton.layer.cornerRadius = 3;
    self.ordorDetailButton.layer.borderWidth = 1;
    self.ordorDetailButton.layer.borderColor = [UIColor colorWithHexString:@"3BBFBF"].CGColor;
    [self.ordorDetailButton setTitleColor:[UIColor colorWithHexString:@"3BBFBF"] forState:UIControlStateNormal];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(NewOrdorListModel *)model {
    _model = model;
    _ordorTitleLabel.text = _model.projectName;
    _ordorNumLabel.text = _model.sjOrderNum;
    _userNameLabel.text = _model.khmc;
    _phoneNumLabel.text = _model.ywhm;
    _ordorStatusLabel.text = _model.stepStatus;
    _timeLabel.text = _model.createDate;
    if (_model.orderId.length > 0) {
        self.MissionDetailButton.hidden = NO;
    }else {
        self.MissionDetailButton.hidden = YES;
    }
    
}



- (IBAction)missionDetailButtonAction:(UIButton *)sender {
    if ([_delegate respondsToSelector:@selector(NewOrdorListCell:model:ActionType:)]) {
        [_delegate NewOrdorListCell:self model:_model ActionType:1];
    }
}
- (IBAction)ordorDetailButtonAction:(UIButton *)sender {
    if ([_delegate respondsToSelector:@selector(NewOrdorListCell:model:ActionType:)]) {
        [_delegate NewOrdorListCell:self model:_model ActionType:2];
    }
}

@end
